Skip to content

Conversation

@Slinxxovo
Copy link

update clearError and getErrorCode then fix setDeviceId

Copilot AI review requested due to automatic review settings February 12, 2026 07:22
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the API interface for the DexHand021S class by simplifying the clear_error method to no longer require a finger_id parameter, fixing the get_error_code method to return a value, and correcting the return type for get_firmware_version. The example code is updated accordingly to use the simplified API.

Changes:

  • Simplified clear_error to only require device_id parameter
  • Fixed get_error_code to return the error code value
  • Updated get_firmware_version_021s return type from c_ubyte to c_uint16

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
examples/DX021S_example.py Updated example to use simplified clear_error API and changed adapter type
dexhand/dexhand.py Modified method signatures and ctypes declarations to match updated SDK
cpp/sdk Updated subproject commit reference

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


def get_error_code(self, device_id, finger_id):
LibDexHand.get_error_code_021s(self.instance, finger_id, device_id)
return LibDexHand.get_error_code_021s(self.instance, finger_id, device_id)
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter order in the C library call (finger_id, device_id) is inconsistent with other methods in this class, which follow the pattern (device_id, finger_id). This inconsistency could lead to incorrect API usage. Consider verifying the correct parameter order with the underlying C library and updating either this call or the argtypes declaration on line 71 to maintain consistency.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant